﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Composite.Modularity;
using Microsoft.Practices.Composite.Regions;
using Microsoft.Practices.Unity;

namespace DiscoveryLogic.Analytics.Modules.Entities
{
	public class PersonModule:IModule 
	{
		public IUnityContainer Container { get; private set; }
		public IRegionManager RegionManager { get; private set; }

		public PersonModule(IUnityContainer container, IRegionManager regionManager)
		{
			Container = container;
			RegionManager = regionManager;
		}

		#region Implementation of IModule

		public void Initialize()
		{
			PersonView personView = Container.Resolve<PersonView>();
			// force event subscription 
			RegionManager.Regions["EntityDetailRegion"].Add(personView);
		}

		#endregion
	}
}
